package whf.framework.entity;

import java.sql.Timestamp;

import org.jdom.Element;

import whf.framework.datasource.DataRow;
import whf.framework.exception.PropertyException;
import whf.framework.security.entity.Dept;
import whf.framework.security.entity.User;

/**
 * 业务对象基本接口
 * @author wanghaifeng
 *
 */
public interface Entity extends Comparable, DataRow{

	/**
	 * @modify wanghaifeng Aug 26, 2006 10:18:16 AM
	 * @return
	 */
	public abstract long getId();

	/**
	 * @modify wanghaifeng Aug 26, 2006 10:18:16 AM
	 * @param id
	 */
	public abstract void setId(long id);

	/**
	 * @modify wanghaifeng Aug 26, 2006 10:18:16 AM
	 * @return
	 */
	public abstract String getName();

	/**
	 * @modify wanghaifeng Aug 26, 2006 10:18:16 AM
	 * @param name
	 */
	public abstract void setName(String name);

	/**
	 * @modify wanghaifeng Aug 26, 2006 10:18:16 AM
	 * @return
	 */
	public abstract String getRemarks();

	/**
	 * @modify wanghaifeng Aug 26, 2006 10:18:16 AM
	 * @param remarks
	 */
	public abstract void setRemarks(String remarks);

	/**
	 * @modify wanghaifeng Aug 26, 2006 10:18:16 AM
	 * @return
	 */
	public abstract Timestamp getCreateDate();

	/**
	 * @modify wanghaifeng Aug 26, 2006 10:18:16 AM
	 * @param createDate
	 */
	public abstract void setCreateDate(Timestamp createDate);

	/**
	 * @modify wanghaifeng Aug 26, 2006 10:18:16 AM
	 * @return
	 */
	public abstract Timestamp getUpdateDate();

	/**
	 * @modify wanghaifeng Aug 26, 2006 10:18:16 AM
	 * @param lastUpdate
	 */
	public abstract void setUpdateDate(Timestamp lastUpdate);

	/**
	 * @modify wanghaifeng Aug 26, 2006 10:18:16 AM
	 * @return
	 */
	public abstract String getCode();

	/**
	 * @modify wanghaifeng Aug 26, 2006 10:18:16 AM
	 * @param code
	 */
	public abstract void setCode(String code);

	/**
	 * @modify wanghaifeng Aug 26, 2006 10:18:16 AM
	 * @return
	 */
	public abstract User getCreateBy();

	/**
	 * @modify wanghaifeng Aug 26, 2006 10:18:16 AM
	 * @param createBy
	 */
	public abstract void setCreateBy(User createBy);

	/**
	 * @modify wanghaifeng Aug 26, 2006 10:18:16 AM
	 * @return
	 */
	public abstract User getUpdateBy();

	/**
	 * @modify wanghaifeng Aug 26, 2006 10:18:16 AM
	 * @param updateBy
	 */
	public abstract void setUpdateBy(User updateBy);

	/**
	 * @modify wanghaifeng Aug 26, 2006 10:18:16 AM
	 * @return
	 */
	public boolean isActive();

	/**
	 * @modify wanghaifeng Aug 26, 2006 10:18:16 AM
	 * @param active
	 */
	public void setActive(boolean active) ;

	/**
	 * @modify wanghaifeng Aug 26, 2006 10:18:16 AM
	 * @return
	 */
	public Dept getDept();

	/**
	 * @modify wanghaifeng Aug 26, 2006 10:18:16 AM
	 * @param dept
	 */
	public void setDept(Dept dept);
	
	/**
	 * @modify wanghaifeng Aug 26, 2006 10:18:16 AM
	 * @param source
	 * @throws PropertyException
	 */
	public void cloneProperties(Object source) throws PropertyException;
	
	/**
	 * 仅仅比较两个对象id是否相同
	 * @param bo
	 * @return
	 */
	public boolean idEquals(Entity bo);
	
	/**
	 * 转换成jdom xml对象格式<br>
	 * 格式为:
	 * <pre>
	 * <bo class='' id=''>
	 *   <property name='' type=''>
	 *     <value></value>
	 *   </property>
	 *   <property name='' type=''>
	 *     <ref class='' id=''></ref>
	 *   </property>
	 *   <property name='' type=''>
	 *     <list>
	 *       <value></value>
	 *       <ref></ref>
	 *     </list>
	 *   </property>
	 * </bo>
	 * </pre>
	 * @modify wanghaifeng Oct 16, 2006 12:59:17 PM
	 * @return
	 */
	public Element toXmlElement() throws PropertyException;
	
}